package com.chixing.day06.clone;

public class School2 implements Cloneable{
    private String name;
    private SchoolBoss2 schoolBoss2;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        School2 sc = (School2) super.clone();
        sc.setSchoolBoss2((SchoolBoss2) sc.getSchoolBoss2().clone());
        return sc;
    }

    public School2(String name, SchoolBoss2 schoolBoss2) {
        this.name = name;
        this.schoolBoss2 = schoolBoss2;
    }

    public School2() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public SchoolBoss2 getSchoolBoss2() {
        return schoolBoss2;
    }

    public void setSchoolBoss2(SchoolBoss2 schoolBoss2) {
        this.schoolBoss2 = schoolBoss2;
    }

    @Override
    public String toString() {
        return "School2{" +
                "name='" + name + '\'' +
                ", schoolBoss2=" + schoolBoss2 +
                '}';
    }
}
